
import 'dart:convert';
import 'package:ichinesereader/models/common/Settings.dart';

ProfileDTO profileUpdateFromJson(String str) =>
    ProfileDTO.fromJson(json.decode(str));

String profileUpdateToJson(ProfileDTO data) => json.encode(data.toJson());

class ProfileDTO {
  String? birthday;
  String? email;
  String? firstName;
  String? gender;
  String? lastName;
  String? level;
  String? nickName;
  Settings? settings;
  String? lang;
  String? theme;

  ProfileDTO({
    this.birthday,
    this.email,
    this.firstName,
    this.gender,
    this.lastName,
    this.level,
    this.nickName,
    this.settings,
    this.lang,
    this.theme,
  });

  ProfileDTO.fromJson(Map<String, dynamic> json) {
    birthday = json['birthday'];
    email = json['email'];
    firstName = json['firstName'];
    gender = json['gender'];
    lastName = json['lastName'];
    level = json['level'];
    nickName = json['nickName'];
    settings = json['settings'] != null
        ? new Settings.fromJson(json['settings'])
        : null;
    lang = json['lang'];
    theme = json['theme'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['birthday'] = this.birthday;
    data['email'] = this.email;
    data['firstName'] = this.firstName;
    data['gender'] = this.gender;
    data['lastName'] = this.lastName;
    data['level'] = this.level;
    data['nickName'] = this.nickName;
    if (this.settings != null) {
      data['settings'] = this.settings!.toJson();
    }
    data['lang'] = this.lang;
    data['theme'] = this.theme;
    return data;
  }
}
